package com.zhku.onlineshop.Dao;

import com.zhku.onlineshop.Pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserDao {

    @Insert("INSERT INTO users (username,password) VALUES (#{username},#{password})")
    boolean AddUser(User user);

    @Select("SELECT * FROM users WHERE username = #{username} AND password = #{password}")
     User SelectByUsernameAndPassword(User user);
    @Select("SELECT * FROM shop_users WHERE username = #{username} AND password = #{password}")
    User SelectByUsernameAndPassword1(User user);

    @Update("UPDATE users SET username = #{username} ,password= #{password} WHERE id = #{id}")
    boolean UpdUserById(User user);
}
